home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_311 / udate / udate.atomclock < prev    next >
Text File  |  1992-05-06  |  1KB  |  34 lines

  1. ; Use this in a script that is automatically executed everytime
  2. ; you boot.  This will cause Atomclock to be executed once a month during
  3. ; your boot sequence.
  4.  
  5. ; set variable currentmonth with the current month
  6. date > env:currentmonth *m
  7.  
  8. ; read file which contains the previous month that atomclock was run and
  9. ; place number in variable atommonth
  10. if not exists sys:s/atommonth
  11.    echo > sys:s/atommonth "00"
  12.    endif
  13. type > env:atommonth sys:s/atommonth
  14.  
  15. ; compare the 2 variables, if different, proceed.....
  16. if not $atommonth eq $currentmonth
  17.  
  18. ; set current month to file containing last execution of atomclock
  19.    date > sys:s/atommonth !%m
  20.  
  21.    stack 10000
  22.    atomclock z/MST ;sets mountain standard time (MST)
  23.    rtclock -w      ;writes new correct time to battery clock
  24.    udate -d        ;adjusts clock if daylight savings time
  25.  
  26. ; optional: keep a record of the number of times atomclock has been
  27. ; total will be in a file called atomclock-cnt.
  28.    if not exists sys:s/atomclock-cnt
  29.       echo > sys:s/atomclock-cnt "0"
  30.       endif
  31.    type > env:count sys:s/atomclock-cnt
  32.    eval <env:count > nil: to sys:s/atomclock-cnt value2 1 op + ?
  33.    endif
  34.